/**
 * 2
 *  
 * @Author : Ruoyu Wang
 * @Datetime : 24-9-21 下午7:24
 */

#include <iostream>

using namespace std;

int main() {
    int m, d, t;
    cin >> m >> d >> t;

    int dis = 0;
    for (int i = 1; i <= t; ++i) {
        if (m >= 10) {
            dis += 60;
            m -= 10;
        } else {
            int tmp = t - i;
            int need = (10 - m + 3) / 4;
            if (need <= tmp) {
                m += 4;
            } else {
                dis += 17;
            }
        }
        if (dis >= d) {
            cout << "YES " << i << endl;
            return 0;
        }
    }

    cout << "NO " << dis << endl;

    return 0;
}

